package core;


/**
 * Class: Move
 * Responsibility: Keep track of two positions: Where the piece moved from,
 * and where it moved to.
 * Collaborators: Position.
 * @author Tobias
 *
 */
public class Move {
	Position from;
	Position to;
	public Position getFrom() {
		return from;
	}
	public void setFrom(Position from) {
		this.from = from;
	}
	public Position getTo() {
		return to;
	}
	public void setTo(Position to) {
		this.to = to;
	}

	/**
	 * Checks if the move starts and ends on same position
	 * @return true if the positions are the same
	 */
	public boolean sameStartAndFinish() {
		return from.equals(to);
	}

	public Move(Position from, Position to) {
		this.from = from;
		this.to = to;
	}

	@Override
	public String toString() {
		return from + " to " + to;
	}

}
